package com.ibl.rover.lite.common.bean;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;

public class RouteBean extends BaseBean {

	@ColumnOrder(Order = 1)
	private String code;
	@ColumnOrder(Order = 2)
	private String Day;

	private static AutomatedQueryStatement AUTO_GEN_QUERY;

	public static final String COL_CODE = "CODE";
	public static final String COL_DAY = "DAY";

	public static final int IDX_COL_CODE = 1;
	public static final int IDX_COL_DAY = 2;

	static {
		AUTO_GEN_QUERY = SQLiteDatabaseHelper
				.getAutoGeneratedStmts(RouteBean.class);
	}

	public RouteBean() {
	}

	@Override
	public void bind(SQLiteStatement sqlLiteStatement) {
		sqlLiteStatement.bindString(IDX_COL_CODE, getCode());
		sqlLiteStatement.bindString(IDX_COL_DAY, getDay());

	}

	@Override
	public <T extends BaseBean> T cursorBind(Cursor cursor) {
		RouteBean routeBean = new RouteBean();
		routeBean.set_id(cursor.getInt(IDX_COL_ID));
		routeBean.setCode(cursor.getString(IDX_COL_CODE));
		routeBean.setDay(cursor.getString(IDX_COL_DAY));

		return (T) routeBean;
	}

	@Override
	public <T extends BaseBean> T cursorInit(Cursor cursor) {
		this.set_id(cursor.getInt(IDX_COL_ID));
		this.setCode(cursor.getString(IDX_COL_CODE));
		this.setDay(cursor.getString(IDX_COL_DAY));
		return (T) this;
	}

	@Override
	public String getCreateTableQuery() {

		return AUTO_GEN_QUERY.getCreateTableQuery();
	}

	@Override
	public String getInsertQuery() {

		return AUTO_GEN_QUERY.getPreparedInsertQuery();
	}

	@Override
	public String getDeleteQuery() {

		return AUTO_GEN_QUERY.getPreparedDeleteQuery();
	}

	@Override
	public String getUpdateQuery() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getTableName() {

		return AUTO_GEN_QUERY.getTableName();
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getDay() {
		return Day;
	}

	public void setDay(String day) {
		Day = day;
	}

	@Override
	public ContentValues bindContentValues() {
		// TODO Auto-generated method stub
		return null;
	}

}
